package com.cn;

public class Account {
    private String number;
    private Double getmoney;
    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public Double getGetmoney() {
        return getmoney;
    }

    public void setGetmoney(Double getmoney) {
        this.getmoney = getmoney;
    }
    public Account(String number,Double getmoney){
        this.getmoney = getmoney;
        this.number = number;
    }


    
    
    public void savemony(Double money){
        this.getmoney += money;
        System.out.println("余额："+this.getmoney);

    }
    public void costmoney(Double money){
        if(this.getmoney>=money){
            this.getmoney -= money;
            System.out.println("余额："+this.getmoney);
        }
        else{
            System.out.println("余额不足");
        }
    }
    
    
}
